#include <iostream>
#include <cstring>
#include <vector>
using namespace std;
int main()
{
	vector< pair<int, int> >pmi, pma;
	int n, t, mi = 0xfffffff, ma = -99999999;
	cin>>n;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			cin>>t;
			if(t > 0){
				if(t >= ma){
					if(t > ma)pma.clear();
					pma.push_back(make_pair(i, j));
					ma = t;
				}
				if(t <= mi){
					if(t < mi)pmi.clear();
					pmi.push_back(make_pair(i, j));
					mi = t;
				}
			}
		}
	}
	cout<<ma<<endl;
	for(int i = 0; i < pma.size(); i++){
		cout<<"<"<<pma[i].first<<" "<<pma[i].second<<">";
	}
	cout<<endl<<mi<<endl;
	for(int i = 0; i < pmi.size(); i++){
		cout<<"<"<<pmi[i].first<<" "<<pmi[i].second<<">";
	}
	return 0;
}
